/**
 * 数组对象去重
 * @type {*[]}
 */
let arr1 = [{'id': 1, 'nickname': '张三'},{'id': 1, 'nickname': '张三1'}]
let arr2 = [{'id': 1, 'nickname': '张三'},{'id': 1, 'nickname': '张三1'}]
//合并两个数组对象
let arr = [...arr1, ...arr2]

var hash = {};
//数组对象去重，ID相同的去重
arr = arr.reduce(function(item, next) {
    hash[next.id] ? '' : hash[next.id] = true && item.push(next);
    return item
}, [])
console.log(arr)
/************************************************************************************************/